function urlHandler() {
  let urldata = {
    viewsLoginUrl: '', //前端跳转路径
    viewsLoginUrlApp: '', //App跳转路径
    liuchengUrl: '', //流程设计器跳转路径
    pageUrl: '', //页面设计器路径
    bdUrl: '', //表单设计器路径
    stbcUrl: '' //水土保持年报系统路径
  }
  let returnUrl = () => {
    let url = location.href.match(/http:\/\/[\s\S]+?\//)
    if (url?.[0]) {
      return url?.[0]
    } else {
      return ''
    }
  }
  if (process.env.NODE_ENV === 'production') {
    console.log(returnUrl())

    urldata.viewsLoginUrl = location.origin + '/gongancase/#/home'
    urldata.viewsLoginUrlApp = returnUrl() + '/mobileApp/web/#/login'
    urldata.liuchengUrl = returnUrl() + '/flowmaking'
    urldata.pageUrl = returnUrl() + '/pagemaking'
    urldata.bdUrl = returnUrl() + '/formmaking'
    urldata.stbcUrl = returnUrl() + '/stbcSystem'
  } else {
    urldata.viewsLoginUrl = 'http://192.168.2.233:22088/#/login'
    urldata.viewsLoginUrlApp = 'http://192.168.2.98:9528/#/login'
    urldata.liuchengUrl = 'http://192.168.2.233:8099/'
    urldata.pageUrl = 'http://192.168.2.168:8080/'
    urldata.bdUrl = 'http://192.168.2.26:9898/'
    urldata.stbcUrl = 'http://192.168.2.26:9898/'
  }
  return urldata
}

const HttpUrlData = urlHandler()

export default class HttpUrl {
  static viewsLoginUrl = HttpUrlData.viewsLoginUrl //前端跳转路径
  static viewsLoginUrlApp = HttpUrlData.viewsLoginUrlApp //App跳转路径
  static liuchengUrl = HttpUrlData.liuchengUrl //流程设计器跳转路径
  static pageUrl = HttpUrlData.pageUrl //页面设计器路径
  static bdUrl = HttpUrlData.bdUrl //表单设计器路径
  static stbcUrl = HttpUrlData.stbcUrl //水土保持年报系统
}
